package com.demo.service.trip;

import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.delegate.DelegateExecution;
import org.springframework.stereotype.Component;

/**
 * 出行方式
 * @author K
 */
@Slf4j
@Component
public class TripService {

    Integer tenThousand = 10000;
    Integer fiveThousand = 5000;
    Integer oneHundred = 100;

    public Integer exec(DelegateExecution execution) {
        String moneyStr = execution.getVariable("money", String.class);
        int money = Integer.parseInt(moneyStr);

        if (money >= tenThousand) {
            return 1;
        } else if (money >= fiveThousand) {
            return 2;
        } else if (money >= oneHundred) {
            return 3;
        } else {
            return 4;
        }
    }
}
